import java.util.Arrays;
import java.util.Collections;
import java.util.Vector;


public class DetectorResults {

	private int numUrlWithFalseAttack = 0;
	private int numScriptsWithFalseAttack = 0;
	private int numUrlWithRealAttack = 0;
	private int numScriptsWithRealAttack = 0;
	private int numNormalizedUrlWithAttackScripts = 0;
	private int numNormalizedAttackScripts = 0;
	private int overlappingFactor = 0;
	private int effectiveUrlTested = 0;
	private int numUnLearnedUrlWithAttack = 0;
	private int numMatchNormalized =0;
	private int numMatchRegular=0;
	private int numNoMatch=0;
	private Vector<Integer> newScriptIncremental = new Vector<Integer>() ;
	private Vector<Integer> newScriptIncrementalSorted = new Vector<Integer>() ;


	public void IncrementOverlap(){
		this.overlappingFactor+=1;
	}
	
	public Vector<Integer> getNewScriptIncrementalSorted() {
		return newScriptIncrementalSorted;
	}

	private Vector<Integer> newScripts = new Vector<Integer>() ;

	public Vector<Integer> getNewScripts() {
		return newScripts;
	}

	public void setNewScripts(Vector<Integer> arr) {
		this.newScripts.addAll(arr);
		Collections.sort(arr);
		Collections.reverse(arr);
		int tmp=0;
		for (int n:newScripts){
			newScriptIncremental.add(tmp+n);
			tmp=tmp+n;
		}
		tmp=0;
		for (int n:arr){
			newScriptIncrementalSorted.add(tmp+n);
			tmp=tmp+n;
		}
	}

	public Vector<Integer> getNewScriptsIncremental() {
		//Collections.sort(newScriptIncremental);
		//Collections.reverse(newScriptIncremental);
		return newScriptIncremental;
	}

	public void IncrementUrlWithFalseAttack(){
		this.numUrlWithFalseAttack+=1;
	}

	public void IncrementScriptsWithRealAttack(int num){
		this.numScriptsWithRealAttack+=num;
	}

	public int getNumUrlWithRealAttack() {
		return numUrlWithRealAttack;
	}

	public int getNumScriptsWithRealAttack() {
		return numScriptsWithRealAttack;
	}

	public void IncrementUrlWithRealAttack(){
		this.numUrlWithRealAttack+=1;
	}

	public void IncrementScriptsWithFalseAttack(int num){
		this.numScriptsWithFalseAttack+=num;
	}

	public void IncrementMatchNorm(){
		this.numMatchNormalized+=1;
	}

	public void IncrementMatchReg(){
		this.numMatchRegular+=1;
	}

	public void IncrementNoMatch(){
		this.numNoMatch+=1;
	}

	public int getNumMatchNormalized() {
		return numMatchNormalized;
	}

	public int getNumMatchRegular() {
		return numMatchRegular;
	}

	public int getNumNoMatch() {
		return numNoMatch;
	}

	public DetectorResults(){

	}

	public int getNumNormalizedUrlWithAttackScripts() {
		return numNormalizedUrlWithAttackScripts;
	}

	public int getNumNormalizedAttackScripts() {
		return numNormalizedAttackScripts;
	}

	public int getOverlappingFactor() {
		return overlappingFactor;
	}

	public int getEffectiveUrlTested() {
		return effectiveUrlTested;
	}
	public int getNumUrlWithFalseAttack() {
		return numUrlWithFalseAttack;
	}
	public int getNumScriptsWithFalseAttack() {
		return numScriptsWithFalseAttack;
	}
	public void setEffectiveUrlTested(int num) {
		this.effectiveUrlTested = num;
	}
	public void SetOverlappingFactor(int num){
		this.overlappingFactor = num;
	}

	public void IncrementNumUnLearnedUrlWithAttack() {
		this.numUnLearnedUrlWithAttack += 1;
	}

	public int getNumUnLearnedUrlWithAttack() {
		return numUnLearnedUrlWithAttack;
	}

}
